home *** CD-ROM | disk | FTP | other *** search
/ FCE Gold Plus / GOLD.iso / pc / fscommand / Xtras / FileXtra4-Mac.sit / FileXtra4_test.dir / 00021_Script_FileOpen behavior < prev    next >
Text File  |  2002-12-20  |  906b  |  29 lines

  1. on mouseUp me
  2.   fxObj = xtra("FileXtra4").new()
  3.   if not(objectP(fxObj)) then
  4.     WriteInfo("*** Could not instantiate FileXtra4.  Is it in the Xtras folder? ***" & RETURN)
  5.     return
  6.   end if
  7.   
  8.   volumeList = fxObj.fx_VolumesToList()
  9.   volumeToUse = volumeList.getAt(1)
  10.   
  11.   if the platform contains "Mac" then
  12.     chosenFile = fxObj.fx_FileOpenDialog(volumeToUse, "TEXT/JPEG/PDF /W8BN")  -- text/jpeg/PDF/word doc
  13.   else
  14.     
  15.   end if
  16.   
  17.   if chosenFile <> "" then
  18.     Alert "File path chosen is: " & chosenFile
  19.     Alert "I will now attempt to open the file..."
  20.     retVal = fxObj.fx_FileOpenDocument(chosenFile)
  21.     Alert "Return value from fx_FileOpenDocument is " & retVal & ", error number is " \
  22.                       & fxObj.fx_ErrorNumber() & ", error string is '" & fxObj.fx_ErrorString() & "'."
  23.   else
  24.     alert "Open dialog cancelled."
  25.   end if
  26.   
  27.   fxObj = 0
  28. end
  29.